package com.weixin.paleituo.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.weixin.paleituo.R;
import com.weixin.paleituo.activity.GoodsStoreActivity;
import com.weixin.paleituo.base.BaseRecycleAdapter;
import com.weixin.paleituo.bean.WordOfMouthStoreBean;
import com.weixin.paleituo.help.RecycleViewHolder;

import java.util.List;

/**
 * Author yichao
 * Time  2018/4/3 13:53
 * Dest  首页推荐店铺
 */

public class HomeRecommandStoreRecycleAdapter extends BaseRecycleAdapter<WordOfMouthStoreBean> {
    public HomeRecommandStoreRecycleAdapter(Context context, List<WordOfMouthStoreBean> datas) {
        super(context, datas, R.layout.item_store_recommand_layout);
    }

    @Override
    protected void setData(RecycleViewHolder holder, final WordOfMouthStoreBean wordOfMouthStoreBean, int position) {
    ImageView imageView= holder.getItemView(R.id.iv_item_store_recommand_layout);
        Glide.with(mContext).load(wordOfMouthStoreBean.getImg()).into(imageView);
        imageView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //ToastUtils.makeText("去店铺");
                GoodsStoreActivity.startActivity(mContext,wordOfMouthStoreBean.getStoreId());
            }
        });
    }
}
